// type DeepReadonly<T> = keyof T extends never?T:{
//     readonly [P in keyof T]:DeepReadonly<T[P]>
// }
type DeepReadonly<T> = {
  readonly [P in keyof T]: keyof T[P] extends never ? T[P] : DeepReadonly<T[P]>
}


// ()=>22 extends Object 为true
// 用 keyof T extends never 判断是否是对象
